<template>
    <div class="topbox">
        <i :class="classleft" v-if="left" @click="handleleft"></i>
        <span v-if="!left" style="width: 10px; height: 10px;"></span>

        <span>{{ title }}</span>

        <i :class="classright" v-if="right" @click="handleright"></i>
        <span v-if="!right" style="width: 10px; height: 10px;"></span>
    </div>
</template>

<script>
export default {
    props:{title:{type:String, default:'标题'},
    left:{type:Boolean, default:false},
    right:{type:Boolean, default:false},
    classleft:{type:String, default:'el-icon-picture'},
    classright:{type:String, default:'el-icon-picture'}},
    data(){
        return{
        }
    },
    methods:{
        handleleft(){
            this.$emit('handleleft')
        },
        handleright(){
            this.$emit('handleright')
        }
    }
}
</script>

<style lang="scss" scoped>
.topbox{
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 0.5rem;
    align-items: center;
    font-size: 18px;
    border-bottom: 1px solid rgb(74, 152, 126);
    margin-bottom: 5px;
}
</style>